﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Thaire.Investment.Repository;
using NHibernate;
using Thaire.Investment.Domains.Transaction;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
         ISession session =   SessionManager.Init().OpenSession();
         using  (session)
         {
             using (ITransaction tran = session.BeginTransaction())
             {
                // FixIncomeSecuritiesHeader ss = session.Get<FixIncomeSecuritiesHeader>(1);
                 FixIncomeSecuritiesHeader ss = new FixIncomeSecuritiesHeader();
                 ss.FixIncomeSecuritiesId = 2;
                 ss.GuarantorName = "วรฉัตร";
                 session.Save(ss);
                 tran.Commit();
              //FixIncomeSecuritiesHeader ss = session.Get<FixIncomeSecuritiesHeader>(1);
              //ss.GuarantorName += ss.GuarantorName; ;
              //ss.CompanyName += ss.CompanyName;
              //session.Update(ss);
              //   tran.Commit();
             }
         
         }
        }
    }
}
